// @ts-ignore
/* eslint-disable */
import { request } from "@umijs/max";

/** 登录接口 */
export async function login(body: UserTypes.LoginParams) {
  return request<UserTypes.TokenInfo>("/auth/login", {
    method: "POST",
    data: body,
  });
}

/** 刷新 token 接口 */
export async function refresh(refreshToken: string) {
  return request<UserTypes.TokenInfo>("/auth/refresh", {
    method: "POST",
    data: { refreshToken },
  });
}

/** 退出登录接口  */
export async function outLogin() {
  return request<Record<string, any>>("/auth/logout", {
    method: "POST",
  });
}
